﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PlayerStat
{
    // Player's Position Definition
    public static class PlayerPos
    {
        public static readonly string GoalKeeper = "G";
        public static readonly string Defense = "D";
        public static readonly string Midfield = "M";
        public static readonly string Forward = "F";
        public static readonly string Substitute = "SUB";
        public static readonly string Unknown = "X";

        public static readonly int GoalKeeperID = 1;
        public static readonly int DefenseID = 2;
        public static readonly int MidfieldID = 3;
        public static readonly int ForwardID = 4;
        public static readonly int SubstituteID = 5;
        public static readonly int UnknownID = 6;

        public static int ParsePosID(string pos)
        {
            switch (pos.ToUpper())
            {
                case "G":
                    return GoalKeeperID;
                case "D":
                    return DefenseID;
                case "M":
                    return MidfieldID;
                case "F":
                    return ForwardID;
                case "SUB":
                    return SubstituteID;
                default:
                    return UnknownID;
            }
        }

        public static int ParsePosIDFr(string pos)
        {
            switch (pos.ToUpper())
            {
                case "Gar":
                    return GoalKeeperID;
                case "Def":
                    return DefenseID;
                case "Mil":
                    return MidfieldID;
                case "Att":
                    return ForwardID;
                default:
                    return UnknownID;
            }
        }
    }
}
